mui.init();

var order_list;
mui.plusReady(function () {
	var self = plus.webview.currentWebview();
	var id = self.catid;
	order_list = new Vue({
		el: '#order_detail',
		data: {
			taoti_details: '',
			payway: 'wxpay',
		},
		mounted() {
            showWatting();
			var api_host = plus.storage.getItem('HOST_URL');
			mui.ajax({
				url: api_host + '/api/questionbank/choice_question/getNewOnesPaperDetail',
				data: {
					'id': id,
				},
				headers:{'User-Token':plus.storage.getItem('UserToken')},
				timeout:3000,
				dataType: 'json',
				type: 'get',
				success: function (msg) {
					if (msg.code == 1) {
						order_list.taoti_details = msg.data;
					} else {
						mui.toast(msg.msg, {duration: '2000',type: 'div'});
					}
				},
				error: function (xhr, type, errorThrown) {
                    mui.toast('加载失败!', {duration: '200',type: 'div'});
				},
				complete:function () {
                    plus.nativeUI.closeWaiting();
                }
			});
		},
		methods: {
			colsePay: function () {
				$('.popMask').hide();
				$('.popAddress').animate({
					'bottom': '-100%'
				}, 300).hide(300).stop(true, true);

				$('.popPay').animate({
					'bottom': '-100%'
				}, 300).show();
			},
			subBtn: function () {
				$('.popMask').show();
				$('.popPay').animate({
					'bottom': '0%'
				}, 300).show();
			},
			pay_way: function (type) {
				this.payway = type;
			},
			openPay: function () {
				var goodsInfo = {
					'group_id': id,
				};
				new pay().start('new_group_question', this.payway, 1, goodsInfo);
			},
		}
	})

})